/**
 * 
 */
package com.nexttwist.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.nexttwist.AudioRecordingFragment;
import com.nexttwist.DashboardFragment;
import com.nexttwist.MyRecoringsFragment;

/**
 * @author HarishKumarG
 *
 */
public class SectionsPagerAdapter extends FragmentPagerAdapter {
	
	public SectionsPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int position) {
		Fragment mFragment = null;
		switch(position) {
		case 0:
			mFragment = new DashboardFragment();
			break;
		case 1:
			mFragment = new MyRecoringsFragment();
			break;
		case 2:
			mFragment = new AudioRecordingFragment();
			break;
		case 3:
			//TODO - My followers
			break;
		case 4:
			//TODO - My Profile / settings
			break;
		default:
			//WTF
			break;
		}
		
		return mFragment;
	}

	@Override
	public int getCount() {
		return 3;
	}
	
	@Override
	public CharSequence getPageTitle(int position) {
		String title = "WTF";
		//TODO -String need to be moved to string.xml
		switch(position) {
		case 0:
			title = "Dashboard";
			break;
		case 1:
			title = "My Recordings";
			break;
		case 2:
			title = "New Recording";
			break;
		case 3:
			//TODO - My followers
			break;
		case 4:
			//TODO - My Profile / settings
			break;
		default:
			//WTF
			break;
		}
		return title;
	}
}
